package model

import (
	"strconv"

	"mini-admin/internal/model/vo"
)

// WechatTemplate 微信模版
type WechatTemplate struct {
	BaseModel
	TemplateID  int    `gorm:"comment:模版号"`
	UserVersion string `gorm:"comment:版本ID"`
	UserDesc    string `gorm:"comment:描述"`
}

// ToVO 转换vo对象
func (t WechatTemplate) ToVO(extJSON string) vo.WechatTemplate {
	return vo.WechatTemplate{
		TemplateID:  strconv.Itoa(t.TemplateID),
		UserVersion: t.UserVersion,
		UserDesc:    t.UserDesc,
		ExtJSON:     extJSON,
	}
}
